@echo off
 
::
:: Important here Env setting
::
set QUESTA_HOME=D:/questasim64_2020.1
set UVM_VERSION=%1
set GCC_HOME=D:/gcc-4.5.0-mingw64vc12
set PATH=%QUESTA_HOME%/win64;%GCC_HOME%/bin;%PATH%

if not exist %QUESTA_HOME%/%UVM_VERSION%/win64/uvm_dpi.dll (
    g++ -g -DQUESTA -W -shared -Bsymbolic -I %QUESTA_HOME%/include %QUESTA_HOME%/verilog_src/%UVM_VERSION%/src/dpi/uvm_dpi.cc -o %QUESTA_HOME%/%UVM_VERSION%/win64/uvm_dpi.dll %QUESTA_HOME%/win64/mtipli.dll -lregex
)
